{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 安装配置环境\n",
    "\n",
    "[同济子豪兄](https://space.bilibili.com/1900783) 2022-6-25"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.安装Neo4j"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 安装Neo4j Desktop"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://neo4j.com/download/"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建新Project：Medical_QA"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 创建新DBMS：medical_neo4j"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 启动DBMS，在浏览器中访问`localhost:7474`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.安装配置Python\n",
    "\n",
    "### 安装基础环境\n",
    "\n",
    "视频：【Windows安装配置Python】https://www.bilibili.com/video/BV1P5411W7g5?p=2\n",
    "\n",
    "视频：【MacOS安装配置Python】https://www.bilibili.com/video/BV1P5411W7g5?p=3\n",
    "\n",
    "视频：【python数据分析神器Jupyter notebook快速入门】https://www.bilibili.com/video/BV1Q4411H7fJ"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 安装第三方库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/\n",
      "Requirement already satisfied: py2neo in d:\\pytorch\\anaconda\\lib\\site-packages (2021.2.4)\n",
      "Requirement already satisfied: pyahocorasick in d:\\pytorch\\anaconda\\lib\\site-packages (2.0.0)\n",
      "Requirement already satisfied: numpy in d:\\pytorch\\anaconda\\lib\\site-packages (1.20.3)\n",
      "Requirement already satisfied: pandas in d:\\pytorch\\anaconda\\lib\\site-packages (1.3.4)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "DEPRECATION: pyodbc 4.0.0-unsupported has a non-standard version number. pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of pyodbc or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: certifi in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (2021.10.8)\n",
      "Requirement already satisfied: interchange~=2021.0.4 in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (2021.0.4)\n",
      "Requirement already satisfied: monotonic in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (1.6)\n",
      "Requirement already satisfied: packaging in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (21.0)\n",
      "Requirement already satisfied: pansi>=2020.7.3 in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (2020.7.3)\n",
      "Requirement already satisfied: pygments>=2.0.0 in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (2.10.0)\n",
      "Requirement already satisfied: six>=1.15.0 in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (1.16.0)\n",
      "Requirement already satisfied: urllib3 in d:\\pytorch\\anaconda\\lib\\site-packages (from py2neo) (1.26.7)\n",
      "Requirement already satisfied: python-dateutil>=2.7.3 in d:\\pytorch\\anaconda\\lib\\site-packages (from pandas) (2.8.2)\n",
      "Requirement already satisfied: pytz>=2017.3 in d:\\pytorch\\anaconda\\lib\\site-packages (from pandas) (2021.3)\n",
      "Requirement already satisfied: pyparsing>=2.0.2 in d:\\pytorch\\anaconda\\lib\\site-packages (from packaging->py2neo) (3.0.4)\n"
     ]
    }
   ],
   "source": [
    "!pip install py2neo pyahocorasick numpy pandas -i https://pypi.tuna.tsinghua.edu.cn/simple/"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 验证安装成功"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "# from py2neo import Graph\n",
    "# 验证安装成功\n",
    "import py2neo\n",
    "\n",
    "# 注意，这里的用户名为neo4j全局用户名，而非DBMS或者database的名称\n",
    "g = Graph('http://localhost:7474', auth=('neo4j', '123456'))\n",
    "print(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
